<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
  <head>
    <title>general reflection tests</title>
    <script src="../../../webcomponentsjs/webcomponents.js"></script>
    <link rel="import" href="../../polymer.html">
    <script src="../../../tools/test/htmltest.js"></script>
    <script src="../../../tools/test/chai/chai.js"></script>
  </head>
  <body>

  <x-one foo="squid"></x-one>

  <polymer-element name="x-one" attributes="Foo bar baz">
    <script>
      Polymer('x-one', {
        Foo: '1',
        observe: {
          blat: 'invalidate'
        }
      });
    </script>
  </polymer-element>

  <polymer-element name="x-two" attributes="Foo bar baz">
    <script>
      Polymer('x-two', {
        publish: {
          zot: 3,
          bar: 2
        },
        Foo: '1',
        skonkChanged: function() {
        }
      });
    </script>
  </polymer-element>

  <x-three foo="3"></x-three>

  <polymer-element name="x-three" extends="x-two" attributes="quux">
    <script>
      Polymer('x-three', {
        skonkChanged: function() {
        }
      });
    </script>
  </polymer-element>

  <script>
    document.addEventListener('polymer-ready', function() {
      var x1 = document.querySelector('x-one');
      chai.assert.equal(x1.Foo, 'squid');
      var x3 = document.querySelector('x-three');
      chai.assert.equal(x3.Foo, '3');
      chai.assert.equal(x3._observeNames.length, 1, 'x3 should have exactly one observed name');
      done();
    });
  </script>
  </body>
</html>
